<?php
namespace User\Model;

use Think\Model;

class JTModel extends Model
{
    CONST STATUS_PENDING = 0;//--待发布--
    CONST STATUS_ACTIVE = 1;//--正常、已发布--
    CONST STATUS_HEAD = 2;//--置顶--
    CONST STATUS_DELETE = 9;//--已删除--

    public static function get_status($status = 'all')
    {
        $label = [
            self::STATUS_PENDING => "待发布",
            self::STATUS_ACTIVE => "正常",
            self::STATUS_HEAD => "置顶"
//            self::STATUS_DELETE => "已删除",
        ];
        if ($status === 'all') {
            return $label;
        }
        if (array_key_exists($status, $label)) {
            return $label[$status];
        }
        return "未知";
    }

}

?>